<template>
  <div class="more-list">
    <div class="wrapper">
      <h3>{{ this.$route.params.title }}</h3>
      <router-link  :to="{name:'MorePlayList',params:{id: item.id,img: item.coverImgUrl,name: item.name,tags: item.tags}}"  class="info url log" v-for="(item,index) in moreListData" :key="index">
        <div class="poster">
          <img :src="item.coverImgUrl" :alt="item.title" ref="image" />
        </div>
        <div class="text-wrap">
          <div class="title" ref="text">{{ item.name }}</div>
        </div>
      </router-link>
    </div>
    <div>
      <p>更多精彩歌单敬请期待~</p>
    </div>
  </div>
</template>

<script>
export default {
  name: "moreList",
  data() {
    return {
      moreListData: [],
    };
  },
  mounted() {
    const moreListUrl = this.HOST + "/top/playlist?&order=hot&offset=0&limit=6";
    this.$axios
      .get(moreListUrl)
      .then(res => {
        this.moreListData = res.data.playlists;
      })
      .catch(err => console.log('获取歌单报错', err.response.data.message));
  },
  components: {
  }
};
</script>

<style scoped>
.wrapper {
  text-align: center;
  margin-bottom: 50px;
  background: #fff;
  clear: both;
  overflow: hidden;
  width: 100%;
}

h3 {
  font-size: 22px;
  text-align: left;
  margin: 15px;
}

.wrapper .info {
  width: 40%;
  float: left;
  text-align: center;
  padding-left: 17px;
  display: block;
  text-align: left;
  margin-bottom: 10px;
  position: relative;
}

.wrapper .info .text-wrap {
  white-space: wrap;
  width: 100%;
}
div p {
  height: 30px;
  text-align: center;
}
</style>